import 'package:file_transfer/page/about_page.dart';
import 'package:file_transfer/page/config_page.dart';
import 'package:file_transfer/page/file_page.dart';
import 'package:file_transfer/page/home_page.dart';
import 'package:file_transfer/page/login_page.dart';
import 'package:file_transfer/page/receive_sharing_page.dart';
import 'package:flutter/material.dart';

class SimpleRoute {

  SimpleRoute._in();
  static final SimpleRoute _instance = SimpleRoute._in();

  factory SimpleRoute.instance(){
    return _instance;
  }

  toHomePage(BuildContext context) {
    Navigator.pushReplacement(
        context, MaterialPageRoute(builder: (_) => const HomePage()));
  }

  toLoginPage(BuildContext context) {
    Navigator.push(
        context, MaterialPageRoute(builder: (_) => const LoginPage()));
  }

  toReceiveSharingPage(BuildContext context){
    Navigator.push(
        context, MaterialPageRoute(builder: (_) => const ReceiveSharingPage()));
  }

  toConfigPage(BuildContext context){
    Navigator.push(
        context, MaterialPageRoute(builder: (_) => const ConfigPage()));
  }

  toAboutPage(BuildContext context){
    Navigator.push(
        context, MaterialPageRoute(builder: (_) => const AboutPage()));
  }

  toFilePage(BuildContext context){
    Navigator.push(
        context, MaterialPageRoute(builder: (_) => const FilePage()));
  }

  toBack(BuildContext context){
    Navigator.pop(context);
  }

}
